import { IParam } from '@/core';
import { PropType } from 'vue';

declare type tempMode = 0 | 1 | 2;

export const portletProps = {
	name: {
		type: String,
		default: '',
	},
	isShowTitle: {
		type: Boolean,
		default: false,
	},
	image: {
		type: Object as PropType<IParam>,
		default: () => {},
	},
	title: {
		type: String,
		default: '',
	},
	titlePSLanguageRes: {
		type: String,
		default: '',
	},
	width: {
		type: String,
		default: '100%',
	},
	height: {
		type: String,
		default: '100%',
	},
	actions: {
		type: Array as PropType<IParam[]>,
		default: () => [],
	},
};

export const portletContainerProps = {
    name: {
        type: String,
        default: ''
    },
	layoutOpts: {
		type: Object as PropType<IParam>,
		default: () => {},
	},
	isShowTitle: {
		type: Boolean,
		default: false,
	},
	title: {
		type: String,
		default: '',
	},
    classNames: {
        type: Object as PropType<IParam>,
		default: () => {},
    }
};

export const portletViewProps = {
	name: {
		type: String,
		default: '',
	},
	context: {
		type: Object as PropType<IParam>,
		default: () => {},
	},
	viewParams: {
		type: Object as PropType<IParam>,
		default: () => {},
	},
	tempMode: {
		type: Number as PropType<tempMode>,
		default: 0,
	},
	viewName: {
		type: String,
		default: '',
	},
	userTag: {
		type: String,
	},
	userTag2: {
		type: String,
	},
};
